package cn.com.connext.scrm.repository.master;

import cn.com.connext.scrm.domain.master.BannerList;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by yuanyajun on 2018/7/23.
 */
@Repository
public interface BannerListRepository  extends JpaRepository<BannerList, String>, JpaSpecificationExecutor {

   @Query(value = "select b from BannerList b where b.status=1 and b.deleteFlag=false and b.type = :type")
    List<BannerList> getBannerList(@Param("type") Integer type);

    @Query("select distinct b.type from BannerList b ")
    List<Integer> findAllType();
}
